import React from 'react';

/**
 * 全局状态管理：vuex， redux
 * useReducer 全局状态的管理
*/

import useMyReducer from './redecer'

const App = () => {
    const [state, dispatch] = useMyReducer()
    return (
        <div>
            App
            <hr />
            <button onClick={() => {
                dispatch({ type: "increase" })
            }}>加一</button>
            <span>{state.count}</span>
            <button onClick={() => {
                dispatch({ type: "decrease" })
            }}>减一</button>
        </div>
    );
}

export default App;
